package com.example.demo;

import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Component;
import org.noear.solon.flow.FlowContext;
import org.noear.solon.flow.Node;
import org.noear.solon.flow.TaskComponent;

import java.util.ArrayList;
import java.util.List;

/**
 * @author airhead
 */
@Component("fetchCommunity")
@Slf4j
public class FetchCommunity implements TaskComponent {
  @Override
  public void run(FlowContext context, Node node) throws Throwable {
    List<String> list = new ArrayList<>() {{
      add("community1");
      add("community2");
    }};

    context.put("list", list);
    context.put("idx", 0);
  }
}
